
/*
 * Karvaly.Class
 * depends: Karvaly.Inheritance
 */
Karvaly.Class = (function() {
    
    var Class = function(superclass, proto) {
	if (!proto) {
	    proto = superclass || {};
	    superclass = this.constructor;
	}
	var subclass = Karvaly.hasOwnProperty(proto, 'constructor') ?
		proto.constructor : proto.constructor = function() {};
        subclass.prototype = new Karvaly.Inheritance(superclass.prototype);
        /*defineProperties(subclass.prototype, {
            superclass : superclass
        });/**/
        Karvaly.defineProperties(subclass.prototype, proto);
        return subclass;
    };
    
    return Class;
})();
